const { defineConfig } = require("@vue/cli-service");
module.exports = defineConfig({
  publicPath: process.env.NODE_ENV === "production" ? "./" : "/",
  chainWebpack: (config) => {
    const svgRule = config.module.rule("svg");
    svgRule.uses.clear();
    svgRule
      .test(/\.svg$/)
      .use("svg-sprite-loader")
      .loader("svg-sprite-loader");
  },

  productionSourceMap: false,
  transpileDependencies: true,
  lintOnSave: false,
  runtimeCompiler: true,
  devServer: {
    // development server port 8000
    port: 8080, //端口
    proxy: {
      "/api": {
        // target: "http://www.jianpingyun.com/api",
        target: "http://localhost:9000/jdbg-api",
        //target: "http://118.195.141.52/:9000/jdbg-api",
        changeOrigin: true,
        pathRewrite: {
          "^/api": "",
        },
      },
      "/javaApi": {
        target:
          "https://www.fastmock.site/mock/3ddb36ed19a06abb22b4c7660935eb99/forest/",
        changeOrigin: true,
        pathRewrite: {
          "^/javaApi": "",
        },
      },
    },
    client: {
      overlay: false,
    },
  },
});
